#!/bin/bash
#Install ZPan
curl -sSLf https://documentation-samples.obs.cn-north-4.myhuaweicloud.com/solution-as-code-publicbucket/solution-as-code-moudle/zpan-based-private-network-disks/open-source-software/install.sh | sh -s zpan
sleep 10s
while true; do
  status=$(whereis zpan)
  echo $status
  if [[ $status =~ /etc/zpan ]]; then
      echo "successfully"
      break
  else
      curl -sSLf https://documentation-samples.obs.cn-north-4.myhuaweicloud.com/solution-as-code-publicbucket/solution-as-code-moudle/zpan-based-private-network-disks/open-source-software/install.sh | sh -s zpan
      echo "wait minitue..."
      wait 10s
  fi
done
systemctl start zpan